package com.aryankh.filter;

import com.aryankh.core.XssHttpServletRequestWapper;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @version 1.0
 * @Author AryanKH
 * @Date 2022/6/6 15:29
 * @Default
 */
public class XssFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        //过滤器的作用,仅仅是将原始的request进行一个包装 通过子类去处理xss相关的事情
        filterChain.doFilter(new XssHttpServletRequestWapper(((HttpServletRequest) servletRequest)),servletResponse);
    }
}
